home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_shs_beam.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
6KB
|
284 lines
# Jones 3D Cog Script
#
# shs_Beam.cog Make the beam break and fall.
#
# [JWC, RKD, TM]
#
# (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ========================================================================================
symbols
message entered
message startup
message arrived
message exited
message touched
message pulse
keyframe smashed=in_die_buckle.key local
material mat1=gen_a4sfx_splash.mat local
material mat2=gen_a4sfx_splash.mat local
sound sndBeam=shs_beam_c.wav local
sound sndDie=tem_temspikes_up_kill_c.wav local
sound sndSplash=sea_launch_splash_c.wav local
sound ambient0=shs_creaky_a1.wav local
sound ambient1=shs_creaky_a2.wav local
sound ambient2=shs_creaky_a3.wav local
sound ambient3=shs_creaky_a4.wav local
sound in_danger=Inxj045.wav local # Danger!
template splashTpl=splshboat local
thing beam
thing beam1 linkid=2
thing beam2 linkid=2
thing cam1
thing c1_t1
thing player local
thing splash0 local
thing ghost0
thing lowerbeams0 linkid=1
thing lowerbeams1 linkid=1
thing lowerbeams2 linkid=1
vector posOffset local
vector angOffset local
int fell=0 local
int broken=0 local
int onbeam=0 local
int killable=0 local
int curCam local
int warning=0 local
int shake=0 local
int vibe=0 local
#SUB-ROUTINES
flex fall local
flex kill local
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
curCam = GetCurrentCamera();
return;
entered:
# Indy is on broken beam
if (GetSenderRef() == beam)
{
onbeam=1;
# beam breaks just once
if (broken == 0)
{
broken=1;
killable=1; # kills indy if he hits other beams
Rotate(beam, 5, 2, .5);
# break sound
PlaySoundLocal(sndBeam, 1.0, 0.0, 0x0, 0);
# camera shake
SetPulse(.1);
sleep(.5);
SetPulse(0.0);
shake=1;
SetPulse(2.0);
return;
}
# Indy is on the beam again, kill him
if ((broken == 1) && (fell == 0))
{
MakeMeStop();
call fall;
}
}
# Indy is safe and beam broken
if (GetSenderId() == 2)
{
if (warning == 0)
{
warning=1;
# "Danger!"
sleep(.25);
PlayVoice(player, in_danger, 1.0, 1);
}
if ((broken == 1) && (fell != 1))
{
call fall;
}
}
return;
exited:
if (GetSenderRef() == beam)
{
onbeam=0;
}
return;
arrived:
if ((GetCurFrame(beam) == 1) && (GetSenderRef() == beam) && (onbeam ==1))
{
call kill;
}
return;
touched:
if ((killable == 1) && (GetSenderId() == 1))
{
call kill;
}
return;
# ========================================================================================
pulse:
if (shake == 0 )
{
vibe = RandBetween(1, 4);
if (vibe == 1)
{
posOffset = '-0.008 0.00 -0.002'; #1 was .005x
angOffset = '0.00 -0.002 0.002';
}
if (vibe == 2)
{
posOffset = '0.008 -0.005 0.002'; #2 was .005x
angOffset = '0.002 0.00 -0.002';
}
if (vibe == 3)
{
posOffset = '0.005 0.005 -0.005'; #3 was .002x
angOffset = '-0.002 0.005 -0.005';
}
if (vibe == 4)
{
posOffset = '-0.002 0.00 0.005'; #4
angOffset = '0.00 0.00 0.002';
}
vibe = RandBetween(1, 3);
if (vibe == 1)
{
SetPulse(0.05);
}
if (vibe == 2)
{
SetPulse(0.1);
}
if (vibe == 3)
{
SetPulse(0.15);
}
SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
}
else
{
PlaySoundThing(ambient0[RandBetween(0, 3)], beam, 1, 5, 9, 0);
}
return;
# ========================================================================================
fall:
fell=1;
# stop creaky sound
setpulse (0.0);
# seize control
SetActorFlags(player, 0x200000);
StartCutscene(0);
StopThing(player);
AttachThingToThing(c1_t1, beam);
Sleep(1);
#DetachThing(player);
# cut to watch fall
SetCameraFocus(2, cam1);
SetCameraSecondaryFocus(2, c1_t1);
sleep(.01);
SetCurrentCamera(2);
SetCameraFOV(40, 0, 0);
PlaySoundLocal(sndBeam, 1.0, 0.0, 0x0, 0);
MoveToFrame(beam, 1, 5.0);
sleep(.5);
MoveToFrame(beam, 1, 8.0);
sleep(.5);
MoveToFrame(beam, 1, 12.0);
WaitForStop(beam);
# play splash
splash0 = CreateThing(splashTpl, ghost0);
MaterialAnim(mat1, 16, 0x0);
MaterialAnim(mat2, 16, 0x0);
PlaySoundLocal(sndSplash, 1.0, 0.0, 0x0, 0);
SetLifeLeft(splash0, 0.5);
sleep(1);
# return control
SetCameraLookInterp(2, 0); # kill pan & tilt mode
SetCameraPosInterp(2, 0); # kill dolly mode
Sleep(0.01);
SetCurrentCamera(1);
ResetCameraFOV(0, 0.0);
EndCutscene();
ClearActorFlags(player, 0x200000);
killable=0;
return;
kill:
# kill player
PlayKey(player, smashed, 10, 0x14, 0);
PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
DamageThing(player, 1000, 0x80, beam);
DamageThing(player, 1000, 0x80, lowerbeams0);
DamageThing(player, 1000, 0x80, lowerbeams1);
DamageThing(player, 1000, 0x80, lowerbeams2);
return;
end